package com.dingwen.treasure.websocket.client.controller;

import com.dingwen.treasure.websocket.client.handler.TreasureWebSocketHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 　PushController
 * 　@author dingwen
 * 　@date 2022/8/31
 */
@RestController
@RequestMapping("push")
public class PushController {


    @Resource(name = "treasureWebSocketHandler")
    private TreasureWebSocketHandler treasureWebSocketHandler;


    @GetMapping
    public void test(@RequestParam("message") String message) {
        treasureWebSocketHandler.sendMessage(message);
    }
}
